import 'package:flutter/material.dart';
import 'dart:ui';

class Home extends StatefulWidget {
  @override
  _Home createState() => _Home();
}

class _Home extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>[
          SliverAppBar(
            elevation: 0,
            expandedHeight: 240.0,
            floating: false,
            pinned: true,
            // snap: false,
            brightness: Brightness.dark,
            title: Container(
              width: double.infinity,
              height: 32.0,
              decoration: BoxDecoration(
                color: Color.fromARGB(125, 255, 255, 255),
                borderRadius: BorderRadius.circular(32.0),
              ),
            ),
            // centerTitle: true,
            actions: <Widget>[
              IconButton(
                icon: Icon(Icons.notifications_none),
                onPressed: () {
                  print("通知");
                },
              ),
            ],
            flexibleSpace: FlexibleSpaceBar(
              background: Image.asset(
                "assets/images/a.jpg",
                fit: BoxFit.cover,
                alignment: Alignment.bottomCenter,
              ),
            ),
          ),
          SliverFixedExtentList(
            itemExtent: 50.0,
            delegate: SliverChildBuilderDelegate(
              (context, index) => ListTile(
                title: Text("Item[$index] $index"),
              ),
              childCount: 30,
            ),
          ),
        ],
      ),
    );
  }
}
